package edu.jamestang.yeb.util;

import edu.jamestang.yeb.entity.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @author JamesTang
 * @date 2021/12/20 17:11
 */
public class AdminUtil {

    public static Admin getCurrentAdmin(){
        return (Admin) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
